//最大化问题，发现有上界，用二分方法来做
#include <iostream>
#include <algorithm>
typedef long long LL;
using namespace std;
const int N = 100010;
int h[N], w[N];
int n, k;
int l = 0, r = 0;

bool check(int mid)
{
    LL all = 0;
    for(int i = 0; i < n; ++i)
    {
        int hi = h[i] / mid;
        int wi = w[i] / mid;
        all += (LL)hi * wi;
        if(all >= k) return true;
    }
    return false;
}

int main()
{
    cin >> n >> k;
    
    for(int i = 0; i < n; ++i)
    {
        cin >> h[i] >> w[i];
        r = max(r, min(h[i], w[i]));
    }
    while(l < r)
    {
        int mid = l + r + 1 >> 1;
        if(check(mid)) l = mid; 
        else r = mid - 1;
    }
    cout << l << endl;
    return 0;
}